#! /usr/bin/perl -w

use Expect;
use strict;

my $timeout = 10;
my $username = "test";
my $password = "test";

my $exp = Expect->spawn("passwd", "test");
#$exp->log_stdout(0);

$exp->expect($timeout,
              [ qr/password: /i, sub { my $self = shift;
                                       $self->send("$password\n");
                                       exp_continue; }],
              "\$");
